/*
 * Copyright (c) 2006-2021, Ulandlink Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-09-18     lfz         first version
 */
#include <rtthread.h>
#include "app_misc_srv.h"
#include "app_misc_task.h"

#define MISC_LOG_LVL				3
#ifndef LOG_TAG
#define LOG_TAG                    "misc.tack"
#endif
#undef LOG_LVL
#if defined(MISC_LOG_LVL)
#define LOG_LVL                    MISC_LOG_LVL
#endif
#include <elog.h>

#define MISC_STACK_SIZE		     		    (768)
#define MISC_PRIORITY		     			(27)
#define MISC_TIMESLICE            	        (50)

static void app_misc_entry(void *param)
{ 
	if (!app_srv_misc_init()){
		log_e("app_srv_misc_init() error");	
		return; 
	}
	while(1){
		app_srv_state();
	}
}

int32_t app_misc_tack(void)
{
	rt_thread_t misc = RT_NULL;
	misc = rt_thread_create("misc",
							app_misc_entry,
							RT_NULL,
							MISC_STACK_SIZE,
							MISC_PRIORITY,
							MISC_TIMESLICE);
	if (misc == RT_NULL){
		log_e("misc init error");
		return -1;
	}
	log_i("misc init ok");	
	rt_thread_startup(misc);
	return 0;
}
//INIT_APP_EXPORT(app_misc_tack);

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
